Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CLP IR types from the ffi to the ir namespace. #199

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

kirkrodrigues
Copy link
Member

@kirkrodrigues kirkrodrigues commented Dec 29, 2023

Description

When developing the FFI code, we created new types in the ffi namespace instead of using the existing ones in CLP core. This was to avoid depending on types within CLP core which would require FFI libraries to pull in complicated CLP core source files.

As part of restructuring CLP core to be more modular, this PR moves the types into the ir namespace. In a future PR, we will remove any redundant types from CLP core (e.g., epochtime_t will be replaced with epoch_time_ms_t).

The PR also does some minor refactoring like removing a using declaration from a header file, alphabetizing files in CMakeLists.txt, etc.

Validation performed

  • Built successfully.
  • Unit tests pass.

@kirkrodrigues kirkrodrigues requested a review from wraymo December 29, 2023 12:32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we explicitly add ir:: for variables in some files, but for others we have using ir::?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • using declarations are banned in header files.
  • In source files, we use using declarations when it reduces the amount of typing without reducing clarity.
    • Generally, this means if we use a symbol from a namespace multiple times in a source file, we are better off adding a using declaration for that symbol and not fully-qualifying it every time we use it in the source file.
    • However, in some cases, not fully-qualifying a symbol can reduce clarity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense

@kirkrodrigues kirkrodrigues merged commit 0460562 into y-scope:main Dec 29, 2023
5 checks passed
@kirkrodrigues kirkrodrigues deleted the ir-types branch December 29, 2023 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants